home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.std.c
- Path: in2.uu.net!siemens!mlg
- From: mlg@scr.siemens.com (Michael Greenberg)
- Subject: Are macros expanded within unused macro arguments?
- Message-ID: <DM3MC3.Atv@scr.siemens.com>
- Sender: news@scr.siemens.com (NeTnEwS)
- Nntp-Posting-Host: tucker.scr.siemens.com
- Organization: Siemens Corporate Research, Princeton, NJ
- Date: Thu, 1 Feb 1996 13:19:14 GMT
-
-
- Is the following program legal?
-
- #define foo(unused)
- #define bar(x,y)
-
- foo(bar(1))
-
- Excerpt from "6.8.3.1 Argument substitution"
-
- After the arguments for the invocation of a function-like macro have
- been identified, argument substitution takes place. A parameter in the
- replacment list, ..., is replaced by the corresponding argument after
- all macros contained therein have been expanded. Before being
- substituted, each argument's preprocessing tokens are completely macro
- replaced ... .
-
-
-
- --
- Michael Greenberg email: mgreenberg@scr.siemens.com
- Siemens Corporate Research phone: 609-734-3347
- 755 College Road East fax: 609-734-6565
- Princeton, NJ 08540
-